package edu.bistu.sim.xwy.blog.Controller.Repository;
import edu.bistu.sim.xwy.blog.domain.BusUser;
import edu.bistu.sim.xwy.blog.domain.NewsUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.http.ResponseEntity;

import java.util.List;

public interface BusUserResponsitory extends  JpaRepository<BusUser,Integer>{



        List<BusUser> findAll();

        @Query(value = "select a from BusUser a where a.bus_user_name=:username and a.bus_user_password=:password")
        BusUser loginConfirm(@Param("username") String username, @Param("password") String password);

        @Query(value = "select a from BusUser  a where a.bus_user_name=:user_name")
        BusUser findUserByName(@Param("user_name")String user_name);



}
